
<template>
  <div class="searchCom">
    <div class="top">
      <van-icon name="arrow-left" size="20px" @click="backHnadler" />
      <input type="text" class="input" placeholder="搜索...">
      <div class="search-btn">搜索</div>
    </div>
    <div class="bottom">
      <div class="hot">
        <h3>热门搜索</h3>
        <div class="list">
          <span>互联网</span>
        </div>
      </div>
      <div class="history">
        <h3>历史搜索</h3>
        <div class="list">
          <span>互联网</span> <span>互联网</span> <span>互联网</span> <span>互联网</span> <span>互联网</span>
        </div>
      </div>
      <div class="guess">
        <h3>猜你喜欢</h3>
        <div class="list">
          <span>互联网</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
  import { onMounted, ref } from 'vue'
  const emit = defineEmits(['backHnadler'])
  const backHnadler = () => {
    emit('close-search')
  }
</script>

<style lang="less" scoped>
.searchCom {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  background: #fff;
  width: 100vw;
  height: 100vh;
  .top {
    padding: 0 13px;
    display: flex;
    height: 65px;
    justify-content: space-between;
    align-items: center;
    .input {
      box-sizing: border-box;
      border: none;
      width: 250px;
      height: 30px;
      border-radius: 20px;
      padding: 7px 10px;
      color: #cacaca;
      background: #f4f4f4;
      font-size: 12px;
    }
    .search-btn {
      height: 30px;
      width: 60px;
      line-height: 30px;
      text-align: center;
      border-radius: 20px;
      font-size: 17px;
      color: #fff;
      background: #14973d;
    }
  }
  .bottom {
    padding: 0px 15px 0 20px;
    div > h3 {
      margin-top: 25px;
      font-size: 20px;
      color: #2b2b2b;
      font-weight: 600;
    }
    div > .list {
      display: flex;
      flex-wrap: wrap;
      span {
        margin-top: 17px;
        display: inline-block;
        padding: 10px 15px;
        background: #eeeeee;
        border-radius: 15px;
        color: #a4a4a4;
        margin-right: 10px;
      }
    }
  }
}
</style>
